var SimTube = new Object();
SimTube.rev                = 1;
SimTube.SearchDesc         = 'Search on SimTube';
SimTube.Name               = 'SimTube';
SimTube.Search             = function (keyword, page){
  var result = new Object();
  result.bypage            = 10;
  result.start             = (page-1)*result.bypage+1;
  c = GetContents('http://simtube.com/search/'+page+'/?search_id='+escape(keyword));
  switch (keyword) {
    case '#best':
    c = GetContents('http://simtube.com/search/basic/'+page+'/?sort=rate&search_id=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+0+1+2+3+4+5+6+7+8+9');
    break;
    case '#news':
    c = GetContents('http://simtube.com/search/basic/'+page+'/?sort=addate&search_id=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+0+1+2+3+4+5+6+7+8+9');
    break;
    case '#views':
    c = GetContents('http://simtube.com/search/basic/'+page+'/?sort=viewnum&search_id=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+0+1+2+3+4+5+6+7+8+9');
    break;
  }
  result.total             = ext(' of ','</div>')*1;
  result.VideoInfo = new Array();
  if (page == 1){
    video = new Object();
    video.attr               = 1;
    video.Title              = 'GoTube info';
    video.Description        = 'You can search #best, #news or #views for find the best, the news \n or the most viewed videos on this site.';
    video.Tags               = '#best #news #views';
    result.VideoInfo.push(video);
  }
  while (p = c.indexOf('<div class="video_info_container_v">',p)+1){
    video = new Object();
    video.attr               = 3;
    video.page               = ext('href="');
	video.ThumbnailURL       = ext('src="');
	video.Id                 = ext('http://simtube.com/video/','/');
    video.Title              = ext('title="');
    video.LengthSeconds      = ext('<span class="small_video_text">','m')*60+ext(':','s')*1;
    video.ViewCount          = ext('<strong>','</strong>')*1;
    video.SaveFilename       = video.Title+'.flv';
    video.URL                = 'http://simtube.com/flvideo/'+video.Id+'.flv';
    result.VideoInfo.push(video);
  }
  result.end               = result.start-1+result.VideoInfo.length;
  return result;
}
SiteList.push(SimTube);
